package o;

import android.content.Context;
import android.content.Intent;
import com.huawei.appgallery.wishlist.api.RealizedWishInfo;
import java.util.ArrayList;
import java.util.List;
import o.ewm.n;

public class eny {
    private static eny ॱ;
    private ddj ˋ;
    private dck ˎ;
    private dcl ˏ;

    protected eny() {
        fhz ˋ = fho.ˏ().ˋ("WishService");
        if (ˋ != null) {
            this.ˋ = (ddj) ˋ.ॱ(ddj.class);
            this.ˎ = this.ˋ.ˎ();
            this.ˏ = this.ˋ.ˏ();
            return;
        }
        Logger.e("WishModuleImpl", "wishlist create failed");
    }

    public static synchronized eny ˊ() {
        eny o_eny;
        synchronized (eny.class) {
            if (ॱ == null) {
                ॱ = new eny();
            }
            o_eny = ॱ;
        }
        return o_eny;
    }

    public void ˎ() {
        if (this.ˎ == null) {
            Logger.e("WishModuleImpl", "initWishDatabase failed, wishlist is null");
        } else {
            this.ˎ.ॱ();
        }
    }

    public void ॱ() {
        if (this.ˎ == null) {
            Logger.e("WishModuleImpl", "getWishListFromServer failed, wishlist is null");
        } else {
            this.ˎ.ˋ();
        }
    }

    public void ॱ(boolean z) {
        if (this.ˎ == null) {
            Logger.e("WishModuleImpl", "clearWishListCache failed, wishlist is null");
        } else {
            this.ˎ.ˏ(z);
        }
    }

    public String ˏ(String str) {
        if (this.ˎ != null) {
            return this.ˎ.ˋ(str);
        }
        Logger.e("WishModuleImpl", "deleteWishListCache failed, wishlist is null");
        return null;
    }

    public void ˋ(String str) {
        if (this.ˎ == null) {
            Logger.e("WishModuleImpl", "addWishListCache failed, wishlist is null");
        } else {
            this.ˎ.ˎ(str);
        }
    }

    public void ˏ() {
        if (this.ˎ == null) {
            Logger.e("WishModuleImpl", "clearRealizedWishListDb failed, wishlist is null");
        } else {
            this.ˎ.ˎ();
        }
    }

    public List<RealizedWishInfo> ˋ() {
        if (this.ˎ != null) {
            return this.ˎ.ˏ();
        }
        Logger.e("WishModuleImpl", "getWishListFromDb failed, wishlist is null");
        return new ArrayList();
    }

    public boolean ˎ(String str, int i) {
        if (this.ˎ != null) {
            return this.ˎ.ˎ(str, i);
        }
        Logger.e("WishModuleImpl", "isUselessWish failed, wishlist is null");
        return false;
    }

    public int ʻ() {
        if (this.ˎ != null) {
            return this.ˎ.ʻ();
        }
        Logger.e("WishModuleImpl", "getOnShelfWishList failed, wishlist is null");
        return 0;
    }

    public void ˏ(Context context, RealizedWishInfo realizedWishInfo) {
        if (this.ˎ == null) {
            Logger.e("WishModuleImpl", "sendRealizedWishNotification failed, wishlist is null");
            return;
        }
        cjm ˏ = this.ˎ.ˏ(context, realizedWishInfo);
        String ॱʻ = realizedWishInfo.ॱʻ();
        if (ˏ != null && ॱʻ != null) {
            Logger.ˎ("WishModuleImpl", "WISH app installed:" + realizedWishInfo.ᐝ());
            Intent ॱ = ˏ.ॱ(context);
            dko o_dko = new dko();
            o_dko.ˊ(ॱ);
            o_dko.ˋ(context.getString(n.ߴˋ, new Object[]{ॱʻ}));
            o_dko.ˏ(20180702);
            dkk.ˊ(context, o_dko).ˎ();
        }
    }

    public void ˊ(Context context) {
        if (this.ˋ == null) {
            Logger.e("WishModuleImpl", "startWishActivity failed, wishservice is null");
        } else {
            this.ˋ.ˎ(context);
        }
    }

    public void ˋ(Context context, String str, int i) {
        if (this.ˎ == null) {
            Logger.e("WishModuleImpl", "startWishAddActivity failed, wishlist is null");
            return;
        }
        cjk.ˎ().ˋ(context, this.ˎ.ˏ(str, i));
    }

    public void ˎ(Context context, String str, int i) {
        if (this.ˎ == null) {
            Logger.e("WishModuleImpl", "loginWishAddProcess failed, wishlist is null");
        } else {
            this.ˎ.ˏ(context, str, i);
        }
    }

    public boolean ʼ() {
        if (this.ˏ != null) {
            return this.ˏ.ˋ();
        }
        Logger.e("WishModuleImpl", "downloadFilter failed, wishlist is null");
        return true;
    }

    public void ॱॱ() {
        if (this.ˎ == null) {
            Logger.e("WishModuleImpl", "reportInstalledWishId failed, wishlist is null");
        } else {
            this.ˎ.ˊ();
        }
    }

    public boolean ˏ(String str, String str2, int i) {
        if (this.ˎ != null) {
            return this.ˎ.ˋ(str, str2, i).booleanValue();
        }
        Logger.e("WishModuleImpl", "checkAutoDldState failed, wishlist is null");
        return false;
    }

    public void ˏ(int i) {
        if (this.ˋ == null) {
            Logger.e("WishModuleImpl", "setOpenWishWall failed, iWishService is null");
        } else {
            this.ˋ.ˊ(i);
        }
    }
}
